# 递归 n的阶乘
# def factor(n):
#     start = 1
#     for i in range(1,n + 1):
#         start *= i
#     return start
#
# def factor(n):
#     if n == 1:
#         return 1
#     return n * factor(n - 1)
#
#
# end = factor(5)
# print(end)

# 函数形参的默认值
def add(x, y, debug=False):
    if debug:
        print(f'x={x},y={y}')
    return x + y


# print(add(10,20))
print(add(10, 20, True))

# 关键字传参
def test(x, y):
    print(f'x={x}')
    print(f'y={y}')


test(10, 20)
test(x=10, y=50)

test(y=50, x=60)
